# Maintainer: Peter Budai <peterbudai@hotmail.com>

_realname=entrypoints
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=0.2.3
pkgrel=1
pkgdesc="Discover and load entry points from installed packages (mingw-w64)"
url="https://github.com/takluyver/entrypoints"
arch=('any')
license=('MIT')
makedepends=("${MINGW_PACKAGE_PREFIX}-python3-setuptools")
source=(${_realname}-${pkgver}.tar.gz::https://github.com/takluyver/${_realname}/archive/$pkgver.tar.gz
        ${_realname}-${pkgver}-whl.tar.gz::https://files.pythonhosted.org/packages/py2.py3/e/${_realname}/${_realname}-$pkgver-py2.py3-none-any.whl)
sha256sums=('a628825648fade6fba8dd94cc26e38340ed840fca3e9d5b7b3dbf755b27bbbdd'
            '10ad569bb245e7e2ba425285b9fa3e8178a0dc92fc53b1e1c553805e15a8825b')


package() {
  cd "$srcdir"/

  cd "$srcdir"/
  install -Dm644 entrypoints.py "$pkgdir/${MINGW_PREFIX}/lib/python3.6/site-packages/entrypoints.py"

  _dist="entrypoints-$pkgver.dist-info"
  cd $_dist
  for _i in ./*; do
    install -Dm644 $_i "$pkgdir/${MINGW_PREFIX}/lib/python3.6/site-packages/$_dist/$_i"
  done

  cd "$srcdir/${_realname}-$pkgver"
  install -Dm644 LICENSE "$pkgdir/${MINGW_PREFIX}/share/licenses/$pkgname/LICENSE"
}
